package org.smart4j.chapter1.threadlocal;

/**
 * @ClassName:
 * @Description:
 * @Author: LynnZou
 * @Date: 2017/5/31
 */
public class SequenceA implements Sequence {

    private static int number = 0;

    @Override
    public int getNumber() {
        number += 1;
        return number;
    }

    public static void main(String[] args) {
        Sequence sequence = new SequenceA();

        ClientThread t1 = new ClientThread(sequence);
        ClientThread t2 = new ClientThread(sequence);
        ClientThread t3 = new ClientThread(sequence);

        t1.start();
        t2.start();
        t3.start();
    }
}
